-
Notifications
You must be signed in to change notification settings - Fork 9.4k
magento/magento2#33453: The quantity_and_stock_status attribute is no… #40425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.4-develop
Are you sure you want to change the base?
Conversation
- The attribute was in the excluded attributes list ($defaultExcludedAttributes) in the ProductDataMapper class, which is responsible for indexing data in Elasticsearch/OpenSearch
|
Hi @shmVan. Thank you for your contribution!
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
|
@magento run all tests |
|
@magento run all tests |
|
@magento run Database Compare, Unit Tests |
engcom-Hotel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @shmVan,
Thank you for the contribution!
Can you please help us with the below questions regarding this PR:
- This attribute isn’t designed for searching, please refer to the below file. The attribute is explicitly configured as not searchable and not filterable. Why we are including this attribute in the search index?
- Have you checked this change with Multi-Source Inventory (MSI) which handles stock differently?
- What is the expected index size increase?
Also please cover the test with some automated test in accordance to the DOD.
Thank you
| 'media_gallery', | ||
| 'tier_price', | ||
| 'quantity_and_stock_status', | ||
| 'media_gallery', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this duplicate attribute from here?
Description (*)
Problem: The quantity_and_stock_status attribute with "Use in Layered Navigation" enabled did not appear in filters after reindexing.
Root Cause: The attribute was in the excluded attributes list ($defaultExcludedAttributes) in the ProductDataMapper class, which is responsible for indexing data in Elasticsearch/OpenSearch. As a result:
Solution: Removed 'quantity_and_stock_status' from the $defaultExcludedAttributes array in the file:
Verification: After reindexing, the filter now works and displays both options:
Why are other system attributes indexed but not this one?
Because quantity_and_stock_status is a special deprecated attribute that Magento explicitly excluded from indexing back in 2017 (when this file was created). Other system attributes (like status, visibility, tax_class_id)
are not in this exclusion list, so they are indexed normally.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)